<html>
<head><meta charset="utf-8"><title>rfc-2008 · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html">rfc-2008</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="130096458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/130096458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#130096458">(Jul 22 2018 at 12:41)</a>:</h4>
<p>So I'm happy to take on any of the extra work remaining for <a href="https://github.com/rust-lang/rust/issues/44109" target="_blank" title="https://github.com/rust-lang/rust/issues/44109">#44109</a>.</p>



<a name="130096588"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/130096588" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#130096588">(Jul 22 2018 at 12:44)</a>:</h4>
<p>looks like that is mostly enum variant implementation?</p>



<a name="130096589"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/130096589" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#130096589">(Jul 22 2018 at 12:44)</a>:</h4>
<p>That's all I think.</p>



<a name="130096590"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/130096590" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#130096590">(Jul 22 2018 at 12:44)</a>:</h4>
<p>that is pretty out of cache for me but doesn't seem <em>super</em> hard</p>



<a name="130170694"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/130170694" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#130170694">(Jul 23 2018 at 20:03)</a>:</h4>
<p>Do you think you'd be able to throw together some high level pointers? Only if you've got the time of course.</p>



<a name="130188960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/130188960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#130188960">(Jul 24 2018 at 04:01)</a>:</h4>
<p>yep adding to my list for today</p>



<a name="130347986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/130347986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#130347986">(Jul 26 2018 at 14:41)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> Think you'd be able to put something together here before next week? I know you're not going to be around next week much so it'd be nice to have something to start with. If you don't have time though, don't worry about it.</p>



<a name="130348811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/130348811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#130348811">(Jul 26 2018 at 14:51)</a>:</h4>
<p>whoops forgot -- I had some illegal thing on my to do list, maybe this was it :)</p>



<a name="130349816"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/130349816" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#130349816">(Jul 26 2018 at 15:02)</a>:</h4>
<p><span class="user-mention" data-user-id="116107">@David Wood</span> do <a href="https://github.com/rust-lang/rust/issues/44109#issuecomment-408127667" target="_blank" title="https://github.com/rust-lang/rust/issues/44109#issuecomment-408127667">these notes make sense to you</a>?</p>



<a name="130350549"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/130350549" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#130350549">(Jul 26 2018 at 15:10)</a>:</h4>
<p>Yeah, that's great.</p>



<a name="130406738"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/130406738" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#130406738">(Jul 27 2018 at 12:24)</a>:</h4>
<p>Submitted <a href="https://github.com/rust-lang/rust/issues/52775" target="_blank" title="https://github.com/rust-lang/rust/issues/52775">#52775</a> for it.</p>



<a name="130572320"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/130572320" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#130572320">(Jul 30 2018 at 11:40)</a>:</h4>
<p>A small update here on my progress on this after <a href="https://github.com/rust-lang/rust/issues/52775" target="_blank" title="https://github.com/rust-lang/rust/issues/52775">#52775</a> (given that I'm interested in seeing the whole RFC implemented) - I'm probably going to attempt to do the prereqs for an actual RFC 2008 variants implementation this week - I have no idea how to do that, so I'll just mess around and see if I can come up with something.</p>



<a name="130622022"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/130622022" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#130622022">(Jul 31 2018 at 05:01)</a>:</h4>
<p><span class="user-mention" data-user-id="116107">@David Wood</span> are you interested in doing that refactoring that <span class="user-mention" data-user-id="123856">@Vadim Petrochenkov</span> mentioned? (to separate the def-ids for variants and structs?)</p>



<a name="130626544"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/130626544" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#130626544">(Jul 31 2018 at 07:15)</a>:</h4>
<p>Yeah, definitely <span class="user-mention" data-user-id="116009">@nikomatsakis</span>.</p>



<a name="130975614"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/130975614" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#130975614">(Aug 06 2018 at 12:31)</a>:</h4>
<p><span class="user-mention" data-user-id="116107">@davidtwco</span> did you ever take a stab at that? want some tips for how to do it?</p>



<a name="130975778"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/130975778" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#130975778">(Aug 06 2018 at 12:35)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I ended up not having time, just got back from a short holiday. I'm still happy to do it, would appreciate any tips.</p>



<a name="130978380"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/130978380" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#130978380">(Aug 06 2018 at 13:25)</a>:</h4>
<p>ok hmm I could try to take a look -- this is one of those cases where I guess you make the split and then try to get everything building again, as much as anything =)</p>



<a name="130978382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/130978382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#130978382">(Aug 06 2018 at 13:25)</a>:</h4>
<p>but It hink what I would do is to look at the "struct ctor" cases</p>



<a name="130978386"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/130978386" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#130978386">(Aug 06 2018 at 13:25)</a>:</h4>
<p>it will probalby cleanup the code a bunch, or could potentially do so</p>



<a name="130978431"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/130978431" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#130978431">(Aug 06 2018 at 13:26)</a>:</h4>
<p>since my guess would be there are a number of cases there are special-casing "enums vs tuple structs" now that could hopefully be unified</p>



<a name="131236978"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/131236978" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#131236978">(Aug 10 2018 at 13:25)</a>:</h4>
<p>So, I've not messed around with this that much, but I'm getting nowhere. I can find a bunch of places where struct ctors are registered and all sorts of things like that, but I can't quite work out where it is actually given its id.</p>



<a name="131237354"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/131237354" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#131237354">(Aug 10 2018 at 13:33)</a>:</h4>
<p>the goal here was to separate out the ID of the variant from its constructor?</p>



<a name="131237357"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/131237357" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#131237357">(Aug 10 2018 at 13:33)</a>:</h4>
<p>/me tries to remember</p>



<a name="131237363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/131237363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#131237363">(Aug 10 2018 at 13:33)</a>:</h4>
<p>Yes.</p>



<a name="132654969"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132654969" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132654969">(Aug 23 2018 at 19:00)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I've mostly been looking at this recently and I'm still making very little progress. I understand where the ids are being assigned for structs/variants and what ids are being assigned and used. I've then managed to introduce another id for variants that I intend to identify the ctor separately from the variant. But as soon as I get that compiling I end up with assertions failing here or there that I struggle to track down the root cause of.</p>



<a name="132660080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132660080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132660080">(Aug 23 2018 at 20:52)</a>:</h4>
<p>hmm why would you need separate ctor vs variant?</p>



<a name="132660387"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132660387" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132660387">(Aug 23 2018 at 20:58)</a>:</h4>
<p><span class="user-mention" data-user-id="123856">@Vadim Petrochenkov</span> was suggesting this because they want to assign a distinct privacy</p>



<a name="132660403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132660403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132660403">(Aug 23 2018 at 20:59)</a>:</h4>
<p><span class="user-mention" data-user-id="116107">@davidtwco</span> sorry, I've been playing constant catch up here :(</p>



<a name="132660420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132660420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132660420">(Aug 23 2018 at 20:59)</a>:</h4>
<p>oh, <code>#[non_exhaustive]</code> relies on privacy?</p>



<a name="132660430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132660430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132660430">(Aug 23 2018 at 20:59)</a>:</h4>
<p>just like adding an extra private field?</p>



<a name="132660439"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132660439" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132660439">(Aug 23 2018 at 20:59)</a>:</h4>
<p>(except enums don't have private fields)</p>



<a name="132660448"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132660448" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132660448">(Aug 23 2018 at 20:59)</a>:</h4>
<p>it seems hard to separate constructors from the variants pattern-matching works</p>



<a name="132660507"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132660507" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132660507">(Aug 23 2018 at 21:00)</a>:</h4>
<p>like idk if I could get it right the first few times, I don't know where I would start ripping out the floorboards from</p>



<a name="132660520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132660520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132660520">(Aug 23 2018 at 21:00)</a>:</h4>
<p>and I would be <em>very</em> suspicious if anything actually worked too well</p>



<a name="132660611"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132660611" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132660611">(Aug 23 2018 at 21:02)</a>:</h4>
<p>Also, it seems risky because it wouldn't be imported in one of the namespaces, potentially</p>



<a name="132660623"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132660623" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132660623">(Aug 23 2018 at 21:03)</a>:</h4>
<p>I would prefer it if they weren't split but privacy wasn't used</p>



<a name="132660649"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132660649" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132660649">(Aug 23 2018 at 21:03)</a>:</h4>
<p>or it was checked differently? is it really not possible to do without splitting variants from their constructors?</p>



<a name="132660822"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132660822" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132660822">(Aug 23 2018 at 21:06)</a>:</h4>
<blockquote>
<p>oh, <code>#[non_exhaustive]</code> relies on privacy?</p>
</blockquote>
<p>well, in the case of a tuple struct/variant, it makes the ctor "crate private" I think?</p>



<a name="132660836"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132660836" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132660836">(Aug 23 2018 at 21:07)</a>:</h4>
<blockquote>
<p>or it was checked differently? is it really not possible to do without splitting variants from their constructors?</p>
</blockquote>
<p>I think it is possible</p>



<a name="132660838"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132660838" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132660838">(Aug 23 2018 at 21:07)</a>:</h4>
<p>I'm not sure what corner cases must be considered, though.</p>



<a name="132660849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132660849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132660849">(Aug 23 2018 at 21:07)</a>:</h4>
<p>see also <a href="https://github.com/rust-lang/rust/pull/52775#issuecomment-408644451" target="_blank" title="https://github.com/rust-lang/rust/pull/52775#issuecomment-408644451">@**Vadim Petrochenkov**'s comment</a>, here</p>



<a name="132660850"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132660850" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132660850">(Aug 23 2018 at 21:07)</a>:</h4>
<p>so, like, when type-checking the path to access it in an expression</p>



<a name="132660897"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132660897" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132660897">(Aug 23 2018 at 21:08)</a>:</h4>
<p>we could "just" check that we're in the same crate, if it's marked with the attribute, right?</p>



<a name="132660899"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132660899" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132660899">(Aug 23 2018 at 21:08)</a>:</h4>
<p>I mean, it <em>would</em> be a valid stop-gap?</p>



<a name="132660902"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132660902" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132660902">(Aug 23 2018 at 21:08)</a>:</h4>
<p>presumably yes we could sort of special case this</p>



<a name="132660908"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132660908" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132660908">(Aug 23 2018 at 21:08)</a>:</h4>
<p>or name resolution could too, I guess</p>



<a name="132660918"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132660918" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132660918">(Aug 23 2018 at 21:09)</a>:</h4>
<p>wait, so are the semantics that you have to use <code>Enum::Variant(..)</code> in a pattern, i.e. can't rely on <em>any</em> fields being there?</p>



<a name="132660982"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132660982" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132660982">(Aug 23 2018 at 21:10)</a>:</h4>
<p>no, just that you must include <code>..</code> basically</p>



<a name="132660985"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132660985" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132660985">(Aug 23 2018 at 21:10)</a>:</h4>
<p>i.e., new fields may be added</p>



<a name="132660990"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132660990" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132660990">(Aug 23 2018 at 21:10)</a>:</h4>
<p>I believe that is the semantics, anyway</p>



<a name="132660993"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132660993" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132660993">(Aug 23 2018 at 21:10)</a>:</h4>
<p>at the end?</p>



<a name="132660995"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132660995" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132660995">(Aug 23 2018 at 21:10)</a>:</h4>
<p>right</p>



<a name="132661002"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661002" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661002">(Aug 23 2018 at 21:11)</a>:</h4>
<p>one could also imagine changing privacy so that -- for any given def-id -- we have multiple privacy values</p>



<a name="132661010"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661010" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661010">(Aug 23 2018 at 21:11)</a>:</h4>
<p>e.g., separate type/value privacy</p>



<a name="132661012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661012">(Aug 23 2018 at 21:11)</a>:</h4>
<p>I'm not really sure how that stuff all works anymore</p>



<a name="132661023"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661023" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661023">(Aug 23 2018 at 21:11)</a>:</h4>
<p>the PR that <span class="user-mention" data-user-id="116107">@davidtwco</span> wrote already handled the pattern stuff — or at least some of it</p>



<a name="132661030"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661030" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661030">(Aug 23 2018 at 21:11)</a>:</h4>
<p>but not the expression position</p>



<a name="132661031"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661031" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661031">(Aug 23 2018 at 21:11)</a>:</h4>
<p>why do we want to use privacy? it's not like the attribute disappears?</p>



<a name="132661076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661076">(Aug 23 2018 at 21:12)</a>:</h4>
<p>I think <span class="user-mention" data-user-id="123856">@Vadim Petrochenkov</span> just thought it was an elegant way to achieve the end</p>



<a name="132661079"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661079" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661079">(Aug 23 2018 at 21:12)</a>:</h4>
<p>I'm a bit confused because the interactions seem <em>subtle</em></p>



<a name="132661083"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661083" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661083">(Aug 23 2018 at 21:12)</a>:</h4>
<p>if the constructor doesn't get imported... can I shadow it?</p>



<a name="132661088"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661088" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661088">(Aug 23 2018 at 21:12)</a>:</h4>
<p>presumably yes</p>



<a name="132661089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661089">(Aug 23 2018 at 21:12)</a>:</h4>
<p>does pattern-matching a tuple variant work <em>without</em> it being in the value namespace?</p>



<a name="132661093"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661093" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661093">(Aug 23 2018 at 21:12)</a>:</h4>
<p>this seems <em>very scary</em> to me</p>



<a name="132661095"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661095" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661095">(Aug 23 2018 at 21:12)</a>:</h4>
<p>/me wishes we didn't even have tuple structs most of the time</p>



<a name="132661100"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661100" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661100">(Aug 23 2018 at 21:13)</a>:</h4>
<p>hmm yes <em>that</em> is a good question</p>



<a name="132661108"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661108" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661108">(Aug 23 2018 at 21:13)</a>:</h4>
<p>I want to keep namespaces filled, just in case</p>



<a name="132661110"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661110" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661110">(Aug 23 2018 at 21:13)</a>:</h4>
<p>so I don't think privacy is the answer tbqh</p>



<a name="132661113"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661113" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661113">(Aug 23 2018 at 21:13)</a>:</h4>
<p>interesting. it always seemed a bit surprising to me</p>



<a name="132661115"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661115" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661115">(Aug 23 2018 at 21:13)</a>:</h4>
<p>tuple structs seem even more predisposed to shenanigans</p>



<a name="132661116"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661116" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661116">(Aug 23 2018 at 21:13)</a>:</h4>
<p>but I hadn't thought about it very hard</p>



<a name="132661123"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661123" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661123">(Aug 23 2018 at 21:13)</a>:</h4>
<p>it just seemed like a bit of a "clever hack"</p>



<a name="132661133"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661133" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661133">(Aug 23 2018 at 21:14)</a>:</h4>
<p>I would prefer it for non-braced pattern-matching to have the entry in the value namespace</p>



<a name="132661161"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661161" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661161">(Aug 23 2018 at 21:14)</a>:</h4>
<p>vs directly expressing the idea</p>



<a name="132661166"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661166" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661166">(Aug 23 2018 at 21:14)</a>:</h4>
<p>otherwise we might get some weird results in the future</p>



<a name="132661171"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661171" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661171">(Aug 23 2018 at 21:14)</a>:</h4>
<p>and tbqh I expect you to be matching the constructor, not the type</p>



<a name="132661176"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661176" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661176">(Aug 23 2018 at 21:14)</a>:</h4>
<p>unless you use braces and numbers in which case... welll</p>



<a name="132661177"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661177" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661177">(Aug 23 2018 at 21:14)</a>:</h4>
<p>(that said, it's weird that struct ctors have a distinct def-id, but not enum variants)</p>



<a name="132661182"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661182" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661182">(Aug 23 2018 at 21:15)</a>:</h4>
<p>what's up with that</p>



<a name="132661185"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661185" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661185">(Aug 23 2018 at 21:15)</a>:</h4>
<p>/me still wants <code>fn foo { a: T, b: U } -&gt; V { ... } foo { a, b }</code></p>



<a name="132661187"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661187" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661187">(Aug 23 2018 at 21:15)</a>:</h4>
<p>As I remember it, when matching against a struct (not unit), enum or variant (not unit), we require that <code>..</code> (or <code>_</code> in a match) be included as new fields can be added (where previously if you specified all fields then the compiler wouldn't require a wildcard - now you always require one). And then we lower the visibility of the constructors for those since you can't add new fields if those constructors are being used, since suddenly that fails to compile as not all fields are set.</p>



<a name="132661190"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661190" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661190">(Aug 23 2018 at 21:15)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> struct ctors never worked without separate identity IIRC</p>



<a name="132661195"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661195" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661195">(Aug 23 2018 at 21:15)</a>:</h4>
<p>yes, I know, I just can't remember why</p>



<a name="132661200"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661200" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661200">(Aug 23 2018 at 21:15)</a>:</h4>
<p>it was a hack from the very beginning, and I think it's because they're types</p>



<a name="132661205"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661205" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661205">(Aug 23 2018 at 21:15)</a>:</h4>
<p>variants aren't types</p>



<a name="132661248"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661248" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661248">(Aug 23 2018 at 21:16)</a>:</h4>
<p>so you couldn't have <code>typeof Foo</code> be <code>fn(...) -&gt; Foo</code></p>



<a name="132661249"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661249" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661249">(Aug 23 2018 at 21:16)</a>:</h4>
<p>and <code>Foo</code> being a type</p>



<a name="132661254"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661254" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661254">(Aug 23 2018 at 21:16)</a>:</h4>
<p>yeah. that makes sense. feels sort of like the wrong hack.</p>



<a name="132661257"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661257" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661257">(Aug 23 2018 at 21:16)</a>:</h4>
<p>the same <code>DefId</code> could not lead to both a function type and the tuple struct type itself</p>



<a name="132661258"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661258" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661258">(Aug 23 2018 at 21:16)</a>:</h4>
<p>like, we should have two type-of queries</p>



<a name="132661259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661259">(Aug 23 2018 at 21:16)</a>:</h4>
<p>nowadays we have <code>fn_sig</code> which could maybe handle this, idk</p>



<a name="132661266"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661266" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661266">(Aug 23 2018 at 21:16)</a>:</h4>
<p>/me shrugs</p>



<a name="132661268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661268">(Aug 23 2018 at 21:16)</a>:</h4>
<p>it's always weird that for variants you have to like pull out the return type</p>



<a name="132661269"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661269" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661269">(Aug 23 2018 at 21:16)</a>:</h4>
<p>and handle the leaf case</p>



<a name="132661270"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661270" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661270">(Aug 23 2018 at 21:16)</a>:</h4>
<p><code>type_of</code> and <code>type_decl</code>?</p>



<a name="132661280"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661280" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661280">(Aug 23 2018 at 21:17)</a>:</h4>
<p>w/r/t the ids, both enums and structs have an id as part of <code>Item</code> that identifies them, and then each of those have a <code>VariantDef</code> with a single id - for structs, that is used as the ctor (since a id isn't needed to identify the variant, there's only ever one), and for variants it is used to both identify the variant and as the ctor. So for variants, a new id needs to be added here to separate the variant and it's ctor. At least, that's what I've figured out from digging around.</p>



<a name="132661290"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661290" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661290">(Aug 23 2018 at 21:17)</a>:</h4>
<p>btw I want to rename a bunch of things and take back "def" and "decl" and do cool things with them. or maybe just "def" not "decl"</p>



<a name="132661332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661332">(Aug 23 2018 at 21:18)</a>:</h4>
<p><span class="user-mention" data-user-id="116107">@davidtwco</span> I'm unconvinced privacy is the right way to implement this</p>



<a name="132661336"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661336" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661336">(Aug 23 2018 at 21:18)</a>:</h4>
<p>it seems to create more hazards than problems it solves</p>



<a name="132661356"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661356" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661356">(Aug 23 2018 at 21:19)</a>:</h4>
<p>I'm open to any potential route to implement this, privacy is just the approach that I was advised to take initially and what I've been trying to continue with.</p>



<a name="132661374"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661374" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661374">(Aug 23 2018 at 21:19)</a>:</h4>
<p>IMO the correct approach is that you can't assign a type to an expression that references  a constructor from another crate that has <code>#[non_exhaustive]</code> on it</p>



<a name="132661437"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661437" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661437">(Aug 23 2018 at 21:20)</a>:</h4>
<p>this should be like a dozen lines of code in <code>rustc_typeck</code>, and handle both tuple structs and tuple variants</p>



<a name="132661449"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661449" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661449">(Aug 23 2018 at 21:20)</a>:</h4>
<p>and not require rewriting half the compiler</p>



<a name="132661463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661463">(Aug 23 2018 at 21:21)</a>:</h4>
<p>unless the condition is more subtle than that? is macro hygiene relevant here?</p>



<a name="132661478"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661478" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661478">(Aug 23 2018 at 21:21)</a>:</h4>
<p>I'm not sure.</p>



<a name="132661481"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661481" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661481">(Aug 23 2018 at 21:21)</a>:</h4>
<p>(if so you can maybe traverse the hygiene information, if it's not destroyed in the HIR)</p>



<a name="132661487"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661487" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661487">(Aug 23 2018 at 21:21)</a>:</h4>
<p>worst case you do this check in HIR lowering, because that still has the AST</p>



<a name="132661491"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661491" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661491">(Aug 23 2018 at 21:21)</a>:</h4>
<p>or maybe even in <code>rustc_resolve</code> itself</p>



<a name="132661497"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661497" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661497">(Aug 23 2018 at 21:21)</a>:</h4>
<p>but not when importing the constructor, when resolving an expression to it</p>



<a name="132661659"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661659" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661659">(Aug 23 2018 at 21:24)</a>:</h4>
<p>w/r/t what I've been trying to do (whether that is still relevant or the approach we'll take, I don't know), I <a href="https://gist.github.com/davidtwco/2cc240f7a34d7065428fb67e34ea6b09" target="_blank" title="https://gist.github.com/davidtwco/2cc240f7a34d7065428fb67e34ea6b09">have these notes</a> when I was digging around trying to work out what was happening. And the last attempt I made replaced the <code>NodeId</code> in <code>VariantDef</code> with a enum that had a single <code>NodeId</code> if it was a struct and two if it was an enum - I just assigned the correct one when building the <code>VariantDef</code> (starting in the ast with a <code>NodeId</code> then lowering in the HIR). I added some helper functions to access the <code>ctor_id</code> and <code>variant_id</code> and then removed the <code>id</code> function that was there. That meant that I was made aware via compile errors where the <code>id</code> was used previously so I could dig around in all those locations and try update relevant code. I got that compiling but I ended up with issues in <code>AdtDef::variant_with_id</code>.</p>



<a name="132661677"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661677" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661677">(Aug 23 2018 at 21:25)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/master/src/librustc_resolve/lib.rs#L535" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/librustc_resolve/lib.rs#L535">https://github.com/rust-lang/rust/blob/master/src/librustc_resolve/lib.rs#L535</a></p>



<a name="132661684"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661684" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661684">(Aug 23 2018 at 21:25)</a>:</h4>
<p>basically this case <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_resolve/lib.rs#L555-L556" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/librustc_resolve/lib.rs#L555-L556">https://github.com/rust-lang/rust/blob/master/src/librustc_resolve/lib.rs#L555-L556</a></p>



<a name="132661750"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661750" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661750">(Aug 23 2018 at 21:26)</a>:</h4>
<p>I think all you have to do is pass something to it so it can... oh hmm</p>



<a name="132661760"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661760" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661760">(Aug 23 2018 at 21:27)</a>:</h4>
<p>you might have to do this in <code>rustc_typeck</code> to properly get access to cross-crate attributes</p>



<a name="132661833"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661833" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661833">(Aug 23 2018 at 21:28)</a>:</h4>
<p><span class="user-mention" data-user-id="116107">@davidtwco</span> you can try to add a check here: <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_typeck/check/mod.rs#L3821" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/librustc_typeck/check/mod.rs#L3821">https://github.com/rust-lang/rust/blob/master/src/librustc_typeck/check/mod.rs#L3821</a></p>



<a name="132661835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661835">(Aug 23 2018 at 21:28)</a>:</h4>
<p>just above that line</p>



<a name="132661841"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661841" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661841">(Aug 23 2018 at 21:28)</a>:</h4>
<p>it should work on top of master, without touching any other part of the codebase</p>



<a name="132661849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661849">(Aug 23 2018 at 21:29)</a>:</h4>
<p>IMO that seems vastly preferably to touching privacy</p>



<a name="132661872"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661872" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661872">(Aug 23 2018 at 21:29)</a>:</h4>
<p>ofc <span class="user-mention" data-user-id="123856">@Vadim Petrochenkov</span> might have some really good reasons and I'm sorry if I should've read something before saying all this</p>



<a name="132661938"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132661938" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132661938">(Aug 23 2018 at 21:30)</a>:</h4>
<p>(but without more information, a specific check at one location seems ideal)</p>



<a name="132662023"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662023" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662023">(Aug 23 2018 at 21:32)</a>:</h4>
<p>Of course I have really good reasons :)</p>



<a name="132662025"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662025" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662025">(Aug 23 2018 at 21:32)</a>:</h4>
<p>oh hey!</p>



<a name="132662031"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662031" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662031">(Aug 23 2018 at 21:32)</a>:</h4>
<p>That's exactly the point to make the constructor effectively non-existent for other crates.</p>



<a name="132662032"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662032" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662032">(Aug 23 2018 at 21:32)</a>:</h4>
<p>I'm curious if you prefer being able to shadow the constructors because of separate privacy and how you think patterns should work</p>



<a name="132662043"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662043" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662043">(Aug 23 2018 at 21:33)</a>:</h4>
<p>because IMO <code>Foo(..)</code> working in a pattern without <code>Foo</code> in the value namespace just seems scary</p>



<a name="132662044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662044">(Aug 23 2018 at 21:33)</a>:</h4>
<p>... like this is done now for tuple structs with private fields.</p>



<a name="132662049"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662049" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662049">(Aug 23 2018 at 21:33)</a>:</h4>
<p>hmm</p>



<a name="132662052"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662052" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662052">(Aug 23 2018 at 21:33)</a>:</h4>
<p><del>but you can't pattern-match on those, right?</del> wait, no, you probably can?</p>



<a name="132662096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662096">(Aug 23 2018 at 21:34)</a>:</h4>
<p>So nobody on the internet knows you are a ~dog~ tuple struct.</p>



<a name="132662103"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662103" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662103">(Aug 23 2018 at 21:34)</a>:</h4>
<p>No, you can't match and you can't use them as expressions.</p>



<a name="132662108"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662108" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662108">(Aug 23 2018 at 21:34)</a>:</h4>
<p>okay that seems... consistent</p>



<a name="132662114"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662114" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662114">(Aug 23 2018 at 21:34)</a>:</h4>
<p>what about <code>#[non_exhaustive]</code>, wouldn't that want to allow pattern-matching?</p>



<a name="132662117"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662117" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662117">(Aug 23 2018 at 21:34)</a>:</h4>
<p>Unit structs are the best example here.</p>



<a name="132662118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662118">(Aug 23 2018 at 21:34)</a>:</h4>
<p>if we don't want patterns to work then privacy makes more sense to me</p>



<a name="132662134"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662134" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662134">(Aug 23 2018 at 21:35)</a>:</h4>
<p>but <span class="user-mention" data-user-id="116009">@nikomatsakis</span> was saying something about adding fields at the end of a tuple struct</p>



<a name="132662135"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662135" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662135">(Aug 23 2018 at 21:35)</a>:</h4>
<p>non_exhaustive unit structs are unit only for convenience of the current crate.</p>



<a name="132662137"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662137" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662137">(Aug 23 2018 at 21:35)</a>:</h4>
<p>okay that's really nice :D</p>



<a name="132662143"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662143" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662143">(Aug 23 2018 at 21:35)</a>:</h4>
<p>no more <code>pub  struct Foo(());</code></p>



<a name="132662150"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662150" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662150">(Aug 23 2018 at 21:36)</a>:</h4>
<p>Other crates cannot use <code>let u = U;</code> using the constructor, because that's kind of... exhaustive.</p>



<a name="132662209"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662209" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662209">(Aug 23 2018 at 21:36)</a>:</h4>
<p>so far so good (although it would still possible to check this in <code>rustc_typeck</code> or w/e, but I agree privacy works better than I initially expected</p>



<a name="132662220"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662220" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662220">(Aug 23 2018 at 21:37)</a>:</h4>
<p>so was <span class="user-mention" data-user-id="116009">@nikomatsakis</span> wrong when he said you could pattern-match non-exhaustive tuple-like things with <code>Foo(a, b, ..)</code>? Specifically, that <code>..</code> at the end being mendatory</p>



<a name="132662225"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662225" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662225">(Aug 23 2018 at 21:37)</a>:</h4>
<p>should you not be able to write <code>Foo(..)</code> at all?</p>



<a name="132662229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662229">(Aug 23 2018 at 21:37)</a>:</h4>
<blockquote>
<p>eddyb: it was a hack from the very beginning, and I think it's because they're types<br>
eddyb: variants aren't types</p>
</blockquote>



<a name="132662231"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662231" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662231">(Aug 23 2018 at 21:37)</a>:</h4>
<p>maybe only <code>Foo {..}</code>, if that works with unit/tuple/brace the same</p>



<a name="132662279"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662279" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662279">(Aug 23 2018 at 21:38)</a>:</h4>
<p>Regarding this ^^, I assumed that variants-as-types will happen sooner or later, so variants will need separate def-ids anyway.</p>



<a name="132662283"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662283" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662283">(Aug 23 2018 at 21:38)</a>:</h4>
<p>I disagree, but that depends on what we do to structs</p>



<a name="132662299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662299">(Aug 23 2018 at 21:39)</a>:</h4>
<p>I think <em>originally</em>, tuple struct separate constructor ID was a dirty hack, to avoid having a separate type vs value "type of DefId"</p>



<a name="132662344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662344">(Aug 23 2018 at 21:40)</a>:</h4>
<p>I agree that if you already have separate DefId's, it makes some things simpler/lazier</p>



<a name="132662379"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662379" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662379">(Aug 23 2018 at 21:40)</a>:</h4>
<p>So what are the intended semantics of <code>#[non_exhaustive]</code> on tuple things? not allow pattern-matching at all?</p>



<a name="132662382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662382">(Aug 23 2018 at 21:40)</a>:</h4>
<p>Yes, for tuple structs/variants <code>Foo(..)</code> doesn't works since nobody knows it's a tuple, but <code>Foo  { .. }</code> works.<br>
That's how it's specified in the RFC (full disclosure: under my influence).</p>



<a name="132662388"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662388" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662388">(Aug 23 2018 at 21:40)</a>:</h4>
<p>oh okay so <span class="user-mention" data-user-id="116009">@nikomatsakis</span> was just confused :P</p>



<a name="132662398"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662398" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662398">(Aug 23 2018 at 21:41)</a>:</h4>
<blockquote>
<p>So what are the intended semantics of #[non_exhaustive] on tuple things?</p>
</blockquote>



<a name="132662403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662403">(Aug 23 2018 at 21:41)</a>:</h4>
<p>It pretty much doesn't work, yeah.</p>



<a name="132662409"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662409" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662409">(Aug 23 2018 at 21:41)</a>:</h4>
<p>okay then I agree we don't have much of a choice but treat bracey things as part of the type namespace</p>



<a name="132662414"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662414" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662414">(Aug 23 2018 at 21:41)</a>:</h4>
<p>which is pretty consistent already</p>



<a name="132662429"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662429" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662429">(Aug 23 2018 at 21:41)</a>:</h4>
<p>so a DefId split for privacy is fine, just a lot of work</p>



<a name="132662480"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662480" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662480">(Aug 23 2018 at 21:42)</a>:</h4>
<p>The only possible thing to work is <code>Foo(..)</code> because partial matches still prevent addition of arbitrary new fields.<br>
But for <code>Foo(..)</code> we have <code>Foo { .. }</code> too, so it's not critical.</p>



<a name="132662774"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662774" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662774">(Aug 23 2018 at 21:48)</a>:</h4>
<p><span class="user-mention" data-user-id="123856">@Vadim Petrochenkov</span> Do you have any tips for how I'd go about making this separation in a managable way? I'm eager to see RFC 2008's implementation through and this is a good opportunity to get some familiarity with parts of the compiler that aren't the MIR.</p>



<a name="132662883"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662883" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662883">(Aug 23 2018 at 21:51)</a>:</h4>
<blockquote>
<p>oh okay so <span class="user-mention" data-user-id="116009">@nikomatsakis</span> was just confused :P</p>
</blockquote>
<p>sounds like it, seems fine</p>



<a name="132662893"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662893" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662893">(Aug 23 2018 at 21:51)</a>:</h4>
<p>known to happen on occasion :)</p>



<a name="132662936"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132662936" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132662936">(Aug 23 2018 at 21:52)</a>:</h4>
<p>I'm glad I was scared for no reason, at least</p>



<a name="132663039"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132663039" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132663039">(Aug 23 2018 at 21:54)</a>:</h4>
<blockquote>
<p><span class="user-mention" data-user-id="123856">@Vadim Petrochenkov</span> Do you have any tips for how I'd go about making this separation in a managable way? I'm eager to see RFC 2008's implementation through and this is a good opportunity to get some familiarity with parts of the compiler that aren't the MIR.</p>
</blockquote>
<p>No, sorry, can't say more than "separate them and try to make compiler to work again".<br>
I tried to do this about three years ago and couldn't.</p>



<a name="132663054"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132663054" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132663054">(Aug 23 2018 at 21:55)</a>:</h4>
<p>if it's edition-relevant I could try to step in</p>



<a name="132663058"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132663058" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132663058">(Aug 23 2018 at 21:55)</a>:</h4>
<p>otherwise, probably not</p>



<a name="132663060"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132663060" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132663060">(Aug 23 2018 at 21:55)</a>:</h4>
<p>Now the stuff around def-ids is much cleaner though, so it may be simpler.</p>



<a name="132663135"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132663135" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132663135">(Aug 23 2018 at 21:57)</a>:</h4>
<p>That's... encouraging? I guess I'll just keep at it and see how much it breaks my soul.</p>



<a name="132663140"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132663140" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#132663140">(Aug 23 2018 at 21:57)</a>:</h4>
<p>heh</p>



<a name="161501641"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/161501641" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#161501641">(Mar 23 2019 at 02:18)</a>:</h4>
<p><span class="user-mention" data-user-id="123856">@Vadim Petrochenkov</span> <span class="user-mention" data-user-id="116009">@nikomatsakis</span> I've submitted <a href="https://github.com/rust-lang/rust/issues/59376" target="_blank" title="https://github.com/rust-lang/rust/issues/59376">#59376</a> with an attempt at RFC 2008 for enum variants. It's probably my biggest PR yet, so I'm sure there are plenty of things I could have done better, happy as always to make any requested changes - there are definitely some parts that could be better. This time it separates the <code>DefId</code> of enum variants and their constructors so should have implemented the RFC properly.</p>



<a name="164493533"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/164493533" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Erich Gubler <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#164493533">(Apr 29 2019 at 22:15)</a>:</h4>
<p>Have there been any updates on this? Is the only thing left updating docs before it can be considered for stabilization?</p>



<a name="164494087"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/164494087" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#164494087">(Apr 29 2019 at 22:24)</a>:</h4>
<p>I've been intending to finish it off with any documentation that's needed after it had some time to bake in nightly.</p>



<a name="164494126"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/164494126" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#164494126">(Apr 29 2019 at 22:25)</a>:</h4>
<p>(if you wish to make a PR with documentation or anything like that, please feel free to, but if you don't, I'll eventually get around to it, probably soon-ish now you've reminded me)</p>



<a name="164571881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/164571881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#164571881">(Apr 30 2019 at 20:05)</a>:</h4>
<p>Ah, yeah, that'd be a nice thing to finish up.</p>



<a name="164598532"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/164598532" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#164598532">(May 01 2019 at 04:11)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I'm not sure about <code>#[non_exhaustive]</code> as concrete syntax; the suggestion <code>..</code> from the RFC was imo not considered sufficiently and I know some other people in the team like <code>..</code> also. But it seems like a good discussion item for a meeting.</p>



<a name="164598594"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/164598594" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#164598594">(May 01 2019 at 04:12)</a>:</h4>
<p>As I noted to <span class="user-mention" data-user-id="116107">@davidtwco</span>, it would be nice to also extend the tests re. <code>#[non_exhaustive]</code> to ensure that e.g. <code>#[non_exhaustive] struct A(!);</code> isn't considered uninhabited outside of the crate.</p>



<a name="164598597"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/164598597" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#164598597">(May 01 2019 at 04:12)</a>:</h4>
<p>(since I have plans for <code>#[non_exhaustive]</code> + inhabitedness)</p>



<a name="164622191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/164622191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#164622191">(May 01 2019 at 13:15)</a>:</h4>
<p><span class="user-mention" data-user-id="126931">@centril</span> I'd be fine with discussing the syntax some more</p>



<a name="164841152"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/164841152" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#164841152">(May 04 2019 at 00:27)</a>:</h4>
<p><span class="user-mention" data-user-id="126931">@centril</span> <a href="https://github.com/rust-lang/rust/issues/60529" target="_blank" title="https://github.com/rust-lang/rust/issues/60529">#60529</a></p>



<a name="164841202"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/164841202" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#164841202">(May 04 2019 at 00:28)</a>:</h4>
<p>/me looks</p>



<a name="164862931"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/164862931" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#164862931">(May 04 2019 at 10:52)</a>:</h4>
<p><span class="user-mention" data-user-id="126931">@centril</span> to clarify, you want functions like these added:</p>
<div class="codehilite"><pre><span></span><span class="k">fn</span> <span class="nf">cannot_empty_match_on_empty_struct_to_anything</span><span class="p">(</span><span class="n">x</span>: <span class="nc">UninhabitedStruct</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">A</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">match</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="p">{}</span><span class="w"> </span><span class="c1">//~ ERROR non-exhaustive patterns</span>
<span class="p">}</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">cannot_empty_match_on_empty_tuple_struct_to_anything</span><span class="p">(</span><span class="n">x</span>: <span class="nc">UninhabitedTupleStruct</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">A</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">match</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="p">{}</span><span class="w"> </span><span class="c1">//~ ERROR non-exhaustive patterns</span>
<span class="p">}</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">cannot_empty_match_on_enum_with_empty_variants_struct_to_anything</span><span class="p">(</span><span class="n">x</span>: <span class="nc">UninhabitedVariants</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">A</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">match</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="p">{}</span><span class="w"> </span><span class="c1">//~ ERROR non-exhaustive patterns</span>
<span class="p">}</span><span class="w"></span>
</pre></div>


<p>with these errors:</p>
<div class="codehilite"><pre><span></span>error[E0004]: non-exhaustive patterns: pattern `UninhabitedStruct` of type `uninhabited::UninhabitedStruct` is not handled
  --&gt; /home/david/projects/rust/rust2/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match.rs:23:11
   |
LL |     match x {} //~ ERROR non-exhaustive patterns
   |           ^
   |
   = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms

error[E0004]: non-exhaustive patterns: pattern `UninhabitedTupleStruct` of type `uninhabited::UninhabitedTupleStruct` is not handled
  --&gt; /home/david/projects/rust/rust2/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match.rs:27:11
   |
LL |     match x {} //~ ERROR non-exhaustive patterns
   |           ^
   |
   = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms

error[E0004]: non-exhaustive patterns: multiple patterns of type `uninhabited::UninhabitedVariants` are not handled
  --&gt; /home/david/projects/rust/rust2/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match.rs:31:11
   |
LL |     match x {} //~ ERROR non-exhaustive patterns
   |           ^
   |
   = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
</pre></div>



<a name="164862940"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/164862940" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#164862940">(May 04 2019 at 10:52)</a>:</h4>
<p>That will also fail in the <code>_same_crate</code> variant of the test?</p>



<a name="164862967"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/164862967" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#164862967">(May 04 2019 at 10:53)</a>:</h4>
<p><span class="user-mention" data-user-id="116107">@davidtwco</span> that looks right, with the caveat that if you enable <code>#![feature(exhaustive_patterns)]</code> then <code>_same_crate</code> should work for the structs.</p>



<a name="164862972"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/164862972" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#164862972">(May 04 2019 at 10:53)</a>:</h4>
<p>Alright.</p>



<a name="164862973"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/164862973" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#164862973">(May 04 2019 at 10:53)</a>:</h4>
<p>since that enables the structural behavior for product types</p>



<a name="164863053"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/164863053" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#164863053">(May 04 2019 at 10:55)</a>:</h4>
<p>(but with <code>#![feature(exhaustive_patterns)]</code> and <em>cross crate</em> then <code>UninhabitedMyProduct</code> should still fail)</p>



<a name="164863110"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/164863110" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#164863110">(May 04 2019 at 10:56)</a>:</h4>
<p>That matches what I'm seeing.</p>



<a name="164863122"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/164863122" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#164863122">(May 04 2019 at 10:57)</a>:</h4>
<p>Great <span aria-label="tada" class="emoji emoji-1f389" role="img" title="tada">:tada:</span></p>



<a name="164863129"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/164863129" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#164863129">(May 04 2019 at 10:57)</a>:</h4>
<p>And you also wanted tests with a level of indirection? like in this example from your comment:</p>
<div class="codehilite"><pre><span></span><span class="cp">#![feature(exhaustive_patterns)]</span><span class="w"></span>

<span class="k">enum</span> <span class="nc">V</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">struct</span> <span class="nc">A</span><span class="p">(</span><span class="n">V</span><span class="p">);</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">foo</span><span class="p">(</span><span class="n">x</span>: <span class="nc">A</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nb">String</span> <span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">match</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="164863473"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/164863473" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#164863473">(May 04 2019 at 11:08)</a>:</h4>
<p>Added a bunch of tests to the PR.</p>



<a name="164863638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/164863638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#164863638">(May 04 2019 at 11:12)</a>:</h4>
<p><span class="user-mention" data-user-id="116107">@davidtwco</span> Let's call it an unintentional want ;)</p>



<a name="164863650"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/164863650" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#164863650">(May 04 2019 at 11:13)</a>:</h4>
<p>Would be great to have it but it was mainly for explanatory purposes ^^</p>



<a name="164863654"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/164863654" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#164863654">(May 04 2019 at 11:13)</a>:</h4>
<p>I added them.</p>



<a name="164863657"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/164863657" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#164863657">(May 04 2019 at 11:13)</a>:</h4>
<p>Awesome</p>



<a name="164864222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/164864222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#164864222">(May 04 2019 at 11:31)</a>:</h4>
<p><span class="user-mention" data-user-id="116107">@davidtwco</span> <code>indirect_match_same_crate.rs</code> looks strange; shouldn't it be without <code> #![feature(non_exhaustive)]</code> -- also you say "will compile" but it doesn't seem so?</p>



<a name="164864271"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/164864271" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#164864271">(May 04 2019 at 11:32)</a>:</h4>
<p>if it is without <code>#![feature(non_exhaustive)]</code> then not compiling on some stuff seems expected</p>



<a name="164864331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/164864331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#164864331">(May 04 2019 at 11:34)</a>:</h4>
<p>(being more conservative than my expectation is fine if that is what happens)</p>



<a name="164864388"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/164864388" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#164864388">(May 04 2019 at 11:36)</a>:</h4>
<p>aah sorry, mixed up feature gates!</p>



<a name="164865115"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/164865115" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#164865115">(May 04 2019 at 12:00)</a>:</h4>
<p><span class="user-mention" data-user-id="126931">@centril</span> I think I just mixed up the comment in that test, fixed now.</p>



<a name="164865195"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rfc-2008/near/164865195" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rfc-2008.html#164865195">(May 04 2019 at 12:02)</a>:</h4>
<p>yep</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>